package com.example.education.dao;

import com.example.education.model.Question;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Mapper
@Component
public interface QuestionMapper {
    /**
     * 新增提问
     * @param question
     * @return
     */
    Integer insertQuestion(@Param("question") Question question);


    /**
     * 删除提问
     * @param questionId 提问编号
     * @return
     */
    Integer deleteQuestion(@Param("questionId")Integer questionId);


    /**
     * 精选提问
     * @param questionId
     * @return
     */
    Integer topQuestion(@Param("questionId")Integer questionId);

    /**
     * 取消精选
     * @param questionId
     * @return
     */
    Integer unTopQuestion(@Param("questionId")Integer questionId);

    /**
     * 根据编号查询提问
     * @param questionId
     * @return
     */
    Question getQuestionById(@Param("questionId")Integer questionId);

    /**
     * 根据课程查询提问列表
     * @param courseId
     * @return
     */
    List<Question> getQuestionByCourseId(@Param("courseId")Integer courseId);
}